package com.woniuxy.api;

import com.woniu.cloud.common.dto.Result;
import com.woniuxy.form.ServiceSettlementShoppingCart;
import com.woniuxy.form.SettlementShoppingCart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@FeignClient(value = "user-assembly",contextId = "PriceApi")
@CrossOrigin(origins = {" * "}, allowedHeaders="*")
public interface PriceApi {
    /**
     * 钱包充值
     * @param userBalance 充值余额
     * @return Result
     **/
    @PostMapping("/addUserBalanceByUserId")
    Result addUserBalanceByUserId( @RequestParam("userBalance") Double userBalance);



    /**
     *  用户提现
     * @param userBalance 提现金额
     * @return Result
     */
    @PutMapping("/userBalanceByUserId")
    Result userBalanceByUserId(@RequestParam("userBalance")Double userBalance);

    /**
     * 用户提现回调
     * @return
     */
    @PutMapping("/withdrawalCallback")
    void  userWithdrawalCallback();


    /**
     *商品购物车 结算
     * @param settlementShoppingCart 购物车详情
     * @return
     */
    @PostMapping("/updateSettlementShoppingCart")
    Result updateSettlementShoppingCart(@RequestBody SettlementShoppingCart settlementShoppingCart);

    /**
     * 支付商品订单
     * @param orderId 订单编号
     * @return
     */
    @PutMapping("/updatePayOrder")
    Result updatePayOrder(@RequestParam("orderId") Integer orderId,@RequestParam("price") Double price,@RequestParam("payType") Integer payType);

    /**
     * 服务购物车 结算
     * @param serviceSettlementShoppingCart 服务购物车详情
     * @return
     */
    @PostMapping("/insertServiceCarSettlement")
    Result insertServiceCarSettlement(@RequestBody ServiceSettlementShoppingCart serviceSettlementShoppingCart);

    /**
     * 支付服务订单
     * @param serviceOrderId 服务订单Id
     * @return
     */
    @PutMapping("/updateServiceOrderPay")
    Result updateServiceOrderPay(@RequestParam("serviceOrderId") Integer serviceOrderId,@RequestParam("price") Double price,@RequestParam("payType") Integer payType);

    /**
     * 用户购买积分商品
     * @param scoreGoodId 积分商品id
     * @return
     */
    @PostMapping("/insertUserPayScoreGood")
    Result insertUserPayScoreGood(@RequestParam("scoreGoodId") Integer scoreGoodId);

    /**
     * 用户支付积分订单
     * @param scoreGoodId 积分订单Id
     * @return
     */
    @PutMapping("/updatePayScoreGoodOrder")
    Result updatePayScoreGoodOrder(@RequestParam("scoreGoodId") Integer scoreGoodId ,@RequestParam("price") Double price);

    /**
     * 用户取消商品订单
     * @param orderId 商品订单id
     * @return
     */
    @PutMapping("/updateCancelShoppingOrder")
    Result updateCancelShoppingOrder(@RequestParam("orderId") Integer orderId);

    /**
     * 用户取消服务订单
     * @param serviceOrderId 服务商品订单id
     * @return
     */
    @PutMapping("/updateCancelServiceOrder")
    Result updateCancelServiceOrder(@RequestParam("serviceOrderId") Integer serviceOrderId);

    /**
     * 用户退货
     * @param orderId 商品订单id
     * @return
     */
    @PutMapping("/updateUserReturnGoods")
    Result updateUserReturnGoods(@RequestParam("orderId") Integer orderId);

    /**
     * 商品换货
     * @param orderId 商品订单id
     * @return
     */
    @PutMapping("/updateUserChangeGoods")
    Result updateUserChangeGoods(@RequestParam("orderId") Integer orderId);

    /**
     * 服务商品取消订单
     * @param serviceOrderId 服务商品订单id
     * @return
     *
     */
    @PutMapping("/updateUserReturnServiceGoods")
    Result updateUserReturnServiceGoods(@RequestParam("serviceOrderId") Integer serviceOrderId);



    /**
     * 服务订单支付回调
     * @param request
     * @return
     */
    Result servicePayBack(@RequestParam("request") HttpServletRequest request);


    @PostMapping("/updateUserBalance")
    public Result updateUserBalance(Double userBalance);
}
